//
//  LYQPositionManageCell.m
//  ZCProject
//
//  Created by Zheng on 2016/12/13.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQPositionManageCell.h"

@implementation LYQPositionManageCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.titleLbl];
        [self.contentView addSubview:self.companyLbl];
        [self.contentView addSubview:self.cityLbl];
        [self.contentView addSubview:self.yearLbl];
        [self.contentView addSubview:self.degreeLbl];
        [self.contentView addSubview:self.salaryLbl];
        
        [self layoutSubviewsInContentView];
        
    }
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(kWScale(10));
        make.top.mas_equalTo(kWScale(20));
        make.right.mas_equalTo(-kWScale(10));
    }];
    
    [_companyLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(_titleLbl);
        make.top.equalTo(_titleLbl.mas_bottom).offset(kWScale(12));
    }];
    
    [_cityLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_titleLbl);
        make.top.equalTo(_companyLbl.mas_bottom).offset(kWScale(10));
    }];
    
    [_yearLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_cityLbl.mas_right).offset(kWScale(15));
        make.bottom.equalTo(_cityLbl);
    }];
    
    [_degreeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_yearLbl.mas_right).offset(kWScale(15));
        make.bottom.equalTo(_cityLbl);
    }];
    
    [_salaryLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-kWScale(15));
        make.bottom.equalTo(_cityLbl);
    }];
    
}

#pragma mark - load subviews
- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.font = kWFont(15);
        _titleLbl.textColor = kHexadecimal(@"666666");
        _titleLbl.text = @"欧洲旅游操作";
    }
    return _titleLbl;
}

- (UILabel *)companyLbl {
    if (_companyLbl) {
        return _companyLbl;
    }
    
    _companyLbl = [[UILabel alloc] init];
    _companyLbl.font = kWFont(14);
    _companyLbl.textColor = kHexadecimal(@"666666");
    _companyLbl.text = @"博信(北京)旅游有限责任公司";
    
    return _companyLbl;
}

- (UILabel *)cityLbl {
    if (!_cityLbl) {
        _cityLbl = [[UILabel alloc] init];
        _cityLbl.font = kWFont(14);
        _cityLbl.textColor = kLYQGray;
        _cityLbl.text = @"北京";
    }
    return _cityLbl;
}

- (UILabel *)yearLbl {
    if (!_yearLbl) {
        _yearLbl = [[UILabel alloc] init];
        _yearLbl.font = kWFont(14);
        _yearLbl.textColor = kLYQGray;
        _yearLbl.text = @"3-5年";
    }
    return _yearLbl;
}

- (UILabel *)degreeLbl {
    if (!_degreeLbl) {
        _degreeLbl = [[UILabel alloc] init];
        _degreeLbl.font = kWFont(14);
        _degreeLbl.textColor = kLYQGray;
        _degreeLbl.text = @"本科";
    }
    return _degreeLbl;
}

- (UILabel *)salaryLbl {
    if (!_salaryLbl) {
        _salaryLbl = [[UILabel alloc] init];
        _salaryLbl.font = kWBFont(14);
        _salaryLbl.textColor = kHexadecimal(@"fe6a43");
        _salaryLbl.text = @"10-12K";
    }
    return _salaryLbl;
}

@end
